// 用户模块
export default {
    namespaced: true, // 开启命名空间 防止各模块变量重名
    state() {
        return {
            username: '波仔',
            nickname: '小猴子'
        }
    },
    mutations: {
        changeNickname(state, name) {
            state.nickname = name
        }
    },
    actions: {
        asyncNickname(store, name) {
            store.commit('changeNickname', name)
        }
    }
}